﻿#pragma once
#include "Focus.h"
#include <memory>
#define DEBUG
class Focus;
class TubeFocus : public Focus
{
public:
	TubeFocus();
	~TubeFocus();

	virtual int preprocess(cv::Mat& mat, Attribute& attr); //对图像进行预处理
	virtual int findMaxOutline(cv::Mat& mat); //已经废弃
	virtual int findMaxOutline(cv::Mat& mat, Attribute& attr); //寻找满足条件的所有轮廓
	virtual int draw(cv::Mat& mat, Attribute& attr); //拟合并绘画
	virtual cv::Point2f getMaxOutlineCenter(Attribute& attr) const; //获取目标或者最终轮廓的中心
private:
	int preprocessCircle(cv::Mat& mat, Attribute& attr); //预处理圆
	int preprocessRect(cv::Mat& mat, Attribute& attr);  //预处理矩形
private:
	std::shared_ptr<Focus> fcsptr; //focus指针
	cv::Mat closed; //预处理后的图像
};

